package cn.itcast.weatherapp123;


import android.content.Intent;
import android.os.Bundle;
import android.view.WindowManager;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

import cn.itcast.weatherapp123.adapter.TipsAdapter;
import cn.itcast.weatherapp123.bean.DayWeatherBean;
import cn.itcast.weatherapp123.bean.OtherTipsBean;

public class TipsActivity extends AppCompatActivity {

    private RecyclerView rlvTips;
    private TipsAdapter tipsAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        //去除标题导航栏
        getSupportActionBar().hide();
        //去除时间和电量等
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tips);

        rlvTips=findViewById(R.id.rlv_tips);

        Intent intent=getIntent();
        //intent.getSerializableExtra("tips");因为传过来的是一个对象
        DayWeatherBean dayWeatherBean= (DayWeatherBean) intent.getSerializableExtra("tips");
         if (dayWeatherBean==null){
             return;
         }
        tipsAdapter=new TipsAdapter(this,dayWeatherBean.getmTipsBeans());


        rlvTips.setAdapter(tipsAdapter);

        rlvTips.setLayoutManager(new LinearLayoutManager(this));

    }
}
